<%@ Page Language="C#" AutoEventWireup="true" CodeFile="GridViewAndDropDownListPage.aspx.cs" Inherits="GridViewAndDropDownListPage" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>Untitled Page</title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <asp:GridView ID="GridView1" runat="server" AllowPaging="True" AutoGenerateColumns="False"
            BackColor="White" BorderColor="#999999" BorderStyle="None" BorderWidth="1px"
            CaptionAlign="Right" CellPadding="3" GridLines="Vertical" OnPageIndexChanging="GridView1_PageIndexChanging"
            PageSize="5" OnRowDataBound="GridView1_RowDataBound">
            <PagerSettings FirstPageText="FirstPage" LastPageText="LastPage" Mode="NumericFirstLast"
                NextPageText="Next" PageButtonCount="5" Position="TopAndBottom" PreviousPageText="Previous" />
            <FooterStyle BackColor="#CCCCCC" ForeColor="Black" />
            <Columns>
                <asp:BoundField DataField="Email" HeaderText="Email" />
                <asp:BoundField DataField="CompanyName" HeaderText="CompanyName" />
                <asp:BoundField DataField="ContactName" HeaderText="ContactName" />
                <asp:TemplateField HeaderText="Province">
                    <ItemTemplate>
                        <asp:DropDownList ID="ddlProvince" runat="server" DataSourceID="SqlDataSource1" DataTextField="ProvinceName"
                            DataValueField="ProvinceID" Width="122px">
                        </asp:DropDownList>&nbsp;
                        <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:RecruitVietnamDbConnectionString %>"
                            SelectCommand="SELECT [ProvinceID], [ProvinceName] FROM [tblProvinces]"></asp:SqlDataSource>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:BoundField DataField="ProvinceID" >
                    <ControlStyle Width="0px" />
                    <ItemStyle Width="0px" />
                    <HeaderStyle Width="0px" />
                    <FooterStyle Width="0px" />
                </asp:BoundField>
            </Columns>
            <RowStyle BackColor="#EEEEEE" ForeColor="Black" />
            <SelectedRowStyle BackColor="#008A8C" Font-Bold="True" ForeColor="White" />
            <PagerStyle BackColor="#999999" ForeColor="Black" HorizontalAlign="Right" Wrap="False" />
            <HeaderStyle BackColor="#000084" Font-Bold="True" ForeColor="White" />
            <AlternatingRowStyle BackColor="Gainsboro" />
        </asp:GridView>
    
    </div>
    </form>
</body>
</html>
